package hello;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;

public class ArrayList {
    public static void main(String[] args) {
        Collection<String> list = new java.util.ArrayList<String>();
        list.add("q");
        list.add("w");
        list.add("e");
        list.add("r");
        System.out.println(list);
        String a = "e";
        Iterator<String> it = list.iterator();
        while (it.hasNext()) {
            String str = it.next();
            if (str.equals(a)) {
                it.remove();
            }
        }
        System.out.println(list);

        List<Integer> lili = new java.util.ArrayList<Integer>();
        for (int i = 1; i < 11; i++) {
            lili.add(i);
        }
        System.out.println(lili);
        int num = 5;
        lili.remove(num);
        System.out.println(lili);

    }
}
